package com.hcss.common.vo;

public class ResultMsg {
	private Results state;			// 状态标示符的枚举类
	private Integer flag;			// 是否成功等具体标志
	private String msg; 			// 相关提示信息
	private Object entity; 		// 回传的实体
	private Exception exception;	// 返回异常类型

	public ResultMsg() {
	}
	
	public ResultMsg(Results state) {
		super();
		this.state = state;
	}

	public ResultMsg(Results state, Integer flag) {
	    this.state = state;
	    this.flag = flag;
    }

	public ResultMsg(Results state, String msg) {
	    this.state = state;
	    this.msg = msg;
    }

	public ResultMsg(Object entity) {
	    this.state = Results.SUCCESS;
	    this.entity = entity;
    }

	public ResultMsg(Integer flag, String msg, Object entity, Results state,
			Exception exception) {
		super();
		this.flag = flag;
		this.msg = msg;
		this.entity = entity;
		this.state = state;
		this.exception = exception;
	}

	public Exception getException() {
		return exception;
	}

	public void setException(Exception exception) {
		this.exception = exception;
	}

	public Results getState() {
		return state;
	}

	public void setState(Results state) {
		this.state = state;
	}

	public Integer getFlag() {
		return flag;
	}

	public void setFlag(Integer flag) {
		this.flag = flag;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getEntity() {
		return entity;
	}

	public void setEntity(Object entity) {
		this.entity = entity;
	}

    @Override
    public String toString() {
        return "ResultMsg [flag=" + flag + ", msg=" + msg + ", entity=" + entity + ", state="
                + state + ", exception=" + exception + "]";
    }
    
}
